<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('编辑来信')"/>
    <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/qxEasyUI/themes/default/easyui.css}">
</head>
<style>
    .bootstrap-tagsinput > input {
        display: none;
    }
</style>

<body style="background-color: #F4F6FA">
<div id="admui-siteConTabs " class="main-content" style="margin: 0;padding: 0">
    <form id="form-user-add" class="form-horizontal" th:object="${mmailGetDeal}" style="background-color: #F4F6FA;overflow:hidden;">
        <input id="pkId" name="pkId" type="hidden" th:field="*{pkId}"/>
        <input id="flagInt" name="flagInt" type="hidden" th:field="*{flagInt}"/>
        <input id="flagString" name="flagString" type="hidden" th:field="*{flagString}"/>
        <input id="spareInt" name="spareInt" type="hidden" th:field="*{spareInt}"/>
        <input id="spareString" name="spareString" type="hidden" th:field="*{spareString}"/>
        <input name="stateFlag" type="hidden" th:field="*{stateFlag}"/>
        <input name="openX" type="hidden" th:field="*{openX}"/>
        <input name="liftInt" type="hidden" th:field="*{liftInt}"/>
        <input name="autoGetFlag" type="hidden" th:field="*{autoGetFlag}"/>
        <input name="fkint" type="hidden" th:field="*{fkint}"/>
        <div class="col-sm-12 grid-container" style="display: flex">
            <!--     左       -->
            <div class="col-sm-6 entering-page">
                <!--   来电基本信息     -->
                <div class="col-sm-12 tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px">来信人信息</h4>
                </div>
                <div class="col-sm-12 entering-mt">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">地区：</label>
                        <div class="col-sm-8">
                            <select name="fmAreaNo" th:field="*{fmAreaNo}" id="fmAreaNo"
                                    onchange="dropChgSendTextOnly(this,'fmAreaName');"
                                    th:with="district=${@commonServiceImpl.findArea()}" class="form-control formSelect"
                                    required>
                                <option value="">--请选择--</option>
                                <option th:each="item : ${district}" th:text="${item['CSText']}"
                                        th:value="${item['CSValue']}"></option>
                            </select>
                            <input type="hidden" id="fmAreaName" name="fmAreaName" th:value="*{fmAreaName}"/>
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">地址：</label>
                        <div class="col-sm-8">
                            <input name="fmAddress" th:field="*{fmAddress}" placeholder="请输入"
                                   class="form-control scene " type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label  entering-pd">来信人：</label>
                        <div class="col-sm-8">
                            <input name="fromName" th:field="*{fromName}" placeholder="请输入"
                                   class="form-control scene " type="text">
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">性别：</label>
                        <div class="col-sm-8">
                            <label class="check-box">
                                <input name="fromSex" th:checked="*{fromSex == '1'}" value="1" type="radio">男
                            </label>
                            <label class="check-box">
                                <input name="fromSex" th:checked="*{fromSex == '0'}" value="0" type="radio">女
                            </label>
                        </div>
                    </div>



                </div>
                <div class="col-sm-12 entering-mt">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label is-required entering-pd">联系电话：</label>
                        <div class="col-sm-8">
                            <input name="fromTel" th:field="*{fromTel}" placeholder="请输入"
                                   class="form-control scene theAddress" type="text">
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">电子邮件：</label>
                        <div class="col-sm-8">
                            <input name="fmEmail" th:field="*{fmEmail}" placeholder="请输入"
                                   class="form-control scene theAddress" type="text">
                        </div>
                    </div>


                </div>
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">流水号：</label>
                        <div class="col-sm-8">
                            <input id="wsCode" name="wsCode" th:field="*{wsCode}" placeholder="请输入"
                                   class="form-control serial"
                                   type="text"
                                   maxlength="11" required="" disabled>
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">查询码：</label>
                        <div class="col-sm-8">
                            <input name="wsKey" placeholder="请输入"
                                   class="form-control code"
                                   type="text" th:field="*{wsKey}"
                                   maxlength="11" required="" disabled>
                        </div>
                    </div>
                </div>

            </div>
            <!--     右       -->
            <div class="col-sm-6 entering-page">
                <div class="col-sm-12">
                    <!--   工单基本信息     -->
                    <div class="col-sm-12 tltieBoder">
                        <div class="blueBorder"></div>
                        <h4 style="margin:0 0 0 10px">来信内容详情</h4>
                    </div>
                    <!--工单主题,工单编号,工单性质...-->
                    <div class="col-sm-12">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">主题：</label>
                            <div class="col-sm-8">
                                <input name="fromTopic" th:field="*{fromTopic}" placeholder="请输入"
                                       class="form-control workTheme" type="text" style="width: 220px"
                                       required="">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12" style="margin: 8px 0 8px 0;">
                        <div class="form-group">
                            <label class="col-sm-2 control-label entering-pd">内容：</label>
                            <div class="col-sm-10">
                                <!--呈批-->
                                <textarea name="fmContent" th:field="*{fmContent}" maxlength="3500"
                                          class="form-control workRemark"
                                          rows="3" style="height: 100px"></textarea>
                            </div>
                        </div>
                    </div>


                    <div class="col-sm-12">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">同意公开：</label>
                            <div class="col-sm-8">
                                <label class="check-box">
                                    <input name="openFrom" th:checked="*{openFrom == 1}" value="1" type="radio">是
                                </label>
                                <label class="check-box">
                                    <input name="openFrom" th:checked="*{openFrom == 0}" value="0" type="radio">否
                                </label>
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">来信时间：</label>
                            <div class="col-sm-8">
                                <input name="fromTime" th:field="*{fromTime}" placeholder="请输入" class="form-control" style="width:150px"
                                       type="text">
                            </div>
                        </div>

                    </div>
                    <div class="col-sm-12">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">来信类别：</label>
                            <div class="col-sm-8">
                                <select name="dfmClaNo" id="dfmClaNo"
                                        th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                        onchange="dropChgSendTextOnly(this,'dfmClaName');"
                                        class="form-control formSelect">
                                    <option value="">--请选择--</option>
                                    <th:block th:each="item : ${telTypes}">
                                        <option th:text="${item['CSText']}" th:value="${item['CSValue']}"
                                                th:selected="${item['CSValue']} == *{dfmClaNo}"></option>
                                    </th:block>
                                </select>
                                <input type="hidden" name="dfmClaName" id="dfmClaName" th:value="*{dfmClaName}"/>
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">内容类别：</label>
                            <div class="col-sm-8">
                                <input id="qxCT" style="width:143px;height:31px;" th:value="*{dCntAName}">
                                <input id="txtDcntAcode" name="dCntACode" type="hidden" th:value="*{dCntACode}"/>
                                <input id="txtDCntAName" name="dCntAName" type="hidden" th:value="*{dCntAName}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--内下-->
        <div class="col-sm-12 entering-page">
            <!--   拟办部门     -->
            <div class="col-sm-12 tltieBoder">
                <div class="blueBorder"></div>
                <h4 style="margin:0 0 0 10px">处理情况</h4>
            </div>
            <div class="col-sm-12">
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">处理人：</label>
                    <div class="col-sm-8">
                        <input name="yworker" th:field="*{yworker}" placeholder="请输入"
                               class="form-control scene " type="text">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">处理时间：</label>
                    <div class="col-sm-8">
                        <input name="yeditTime" style="width:150px" th:field="*{yeditTime}" placeholder="请输入"
                               class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-12" style="margin: 8px 0 8px 0;">
                <div class="form-group">
                    <label class="col-sm-2 control-label entering-pd">处理描述：</label>
                    <div class="col-sm-10">
                        <!--呈批-->
                        <textarea name="ydealDesc" th:field="*{ydealDesc}" maxlength="3500"
                                  class="form-control workRemark"
                                  rows="3" style="height: 100px;"></textarea>
                    </div>
                </div>
            </div>

            <div class="col-sm-12">
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">备注：</label>
                    <div class="col-sm-8">
                        <input name="ysysDesc" th:field="*{ysysDesc}" placeholder="请输入"
                               class="form-control scene " type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">处理结果：</label>
                    <div class="col-sm-8">
                        <input name="stateDesc" th:field="*{stateDesc}" placeholder="请输入"
                               class="form-control scene " type="text">
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label entering-pd">重复来信：</label>
                    <div class="col-sm-8">
                        <label class="check-box">
                            <input name="repeatFlag" th:checked="*{repeatFlag == 1}" value="1" type="radio" >是
                        </label>
                        <label class="check-box">
                            <input name="repeatFlag" th:checked="*{repeatFlag == 0}" value="0" type="radio">否
                        </label>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-sm-12 entering-page mb40">
            <!--   拟办部门     -->
            <div class="col-sm-12 tltieBoder">
                <div class="blueBorder"></div>
                <h4 style="margin:0 0 0 10px">工单概况</h4>
            </div>
            <div class="col-sm-12">
                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label entering-pd">是否创建：</label>
                    <div class="col-sm-8">
                        <label class="check-box">
                            <input name="wkFmFlag" th:checked="*{wkFmFlag == 1}" value="1" type="radio">是
                        </label>
                        <label class="check-box">
                            <input name="wkFmFlag" th:checked="*{wkFmFlag == 0}" value="0" type="radio">否
                        </label>
                    </div>
                </div>

                <div class="form-group col-sm-6">
                    <label class="col-sm-4 control-label  entering-pd">工单编号：</label>
                    <div class="col-sm-8">
                        <input name="wkFmNo" th:field="*{wkFmNo}"
                               class="form-control scene " type="text" readonly UNSELECTABLE="on">
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/qxEasyUI/jquery.easyui.min.js}"></script>
<script>
    var prefix = ctx + "system/wsMail";
    var send = ctx + "system/sendBack";
    // 选择内容分类
    $('#qxCT').combotree({
        url: '/system/common/findContentCate',
        required: false,
        onSelect: function (record) {
            $("#txtDcntAcode").val(record.id);
            $("#txtDCntAName").val(record.text);
            var dfmClaName = $("#dfmClaNo option:selected").text();
            var fromName = $("#fromName").val();
            $("#wsTopic").val(fromName + '[' + dfmClaName + ']' + record.text);
        }
    });

    $('#dfmClaNo').change(function () {
        var dfmClaName = $("#dfmClaNo option:selected").text();
        var txtDCntAName = $("#txtDCntAName").val();
        var fromName = $("#fromName").val();
        $("#wsTopic").val(fromName + '[' + dfmClaName + ']' + txtDCntAName);
    })

    function getSetProName() {
        var proName = $("#setProId").find("option:selected").text();
        if (proName === '-请选择-') {
            $("#setProName").val("");
        } else {
            $("#setProName").val(proName);
        }
    }


    function btnSbmtClick() {
        $("#txtCrtStepId").val("400");//转400市级部门处理
        $("#txtCrtStepName").val("市级主办处理中");
        if ($.validate.form()) {
            // 记住标签分页列表地址（从哪个列表点进去的）
            let data = $('#form-user-add').serializeArray();
            $.operate.saveTab(prefix + "/edit", data);
        }
    }
</script>
</body>
</html>

